const Router = require("koa-router");
const router = new Router({ prefix: "/message" });
const { authorverify } = require("../middleware/auth.middleware");

const {
  getallmessage,
  reply,
  deletereply,
  changethumb,
  mangetallmessage,
} = require("../controller/message.controller");

//获取所有留言
router.get("/getallmessage", getallmessage);
//回复留言
router.post("/reply", authorverify, reply);
//删除留言
router.delete("/deletereply/:id", authorverify, deletereply);
//点赞或取消点赞
router.post("/changethumb", authorverify, changethumb);
//管理员获得获取所有留言
router.get("/mangetallmessage", mangetallmessage);

module.exports = router;
